<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition template="../template/layout.xhtml">
	<ui:define name="titulo">#{statusRequisicaoControle.tituloPagina}</ui:define>

	<ui:define name="frConteudo">
		<h:form>
			<h:panelGrid columns="1" border="0" height="100%">
				<!-- bloco de edição -->
				<p:panel header="#{statusRequisicaoControle.tituloPagina}"
					rendered="#{statusRequisicaoControle.estadoCrud}">
					<h:panelGrid columns="1">
						<f:facet name="header">
							<p:messages id="msgErro" />
						</f:facet>
						<h:panelGrid columns="2" border="1"
							rendered="#{!statusRequisicaoControle.estadoFormVazio}">
							<h:outputLabel value="#{msg.statusRequisicao}" for="status" />
							<h:inputText id="status" label="#{msg.statusRequisicao}"
								value="#{statusRequisicaoControle.infoBean.status}" required="true"
								requiredMessage="#{msg.statusRequisicaoRequiredMessage}" />

							<f:facet name="footer">
								<h:panelGroup>
									<center>
										<h:commandButton id="salvarButton" value="#{msg.salvarButton}"
											action="#{statusRequisicaoControle.gravar}"
											rendered="#{statusRequisicaoControle.estadoAdicionar}" />
										<h:commandButton id="alterarButton"
											value="#{msg.alterarButton}" action="#{statusRequisicaoControle.gravar}"
											rendered="#{statusRequisicaoControle.estadoActualizar}" />
										<h:commandButton id="eliminarButton"
											value="#{msg.eliminarButton}"
											action="#{statusRequisicaoControle.excluir}"
											rendered="#{statusRequisicaoControle.estadoEliminar}"
											onclick="if(!confirm('Confirma a exclusão do registo?')) return false;" />
										<h:commandButton id="limparButton" value="#{msg.limparButton}"
											type="reset" rendered="#{statusRequisicaoControle.estadoAdicionar}" />
										<h:commandButton id="cancelarButton"
											value="#{msg.cancelarButton}" action="#{statusRequisicaoControle.voltar}"
											immediate="true" />
									</center>
								</h:panelGroup>
							</f:facet>
						</h:panelGrid>
					</h:panelGrid>
				</p:panel>
				<!-- fim do bloco de edição -->
			</h:panelGrid>
			<h:commandLink action="#{statusRequisicaoControle.voltar}" immediate="true"
				value="#{msg.geralLinkListaRegistos}" />
		</h:form>
	</ui:define>
</ui:composition>
</html>